package com.cxc.websocket.demo.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;

public class SendMsgController {
    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @GetMapping(value = "/list")
    public ResponseEntity<Void> sendMsg(){
        stringRedisTemplate.convertAndSend("channl:sign","有新的消息");
        return ResponseEntity.ok(null);
    }
}
